#!/usr/bin/env python
# coding=utf-8

import httplib2

h = httplib2.Http('.cache')

def umenglog():
    from urllib import urlencode
    url = 'https://www.umeng.com/sso/login'
    r,c = h.request(url,'GET')
    sc = c.decode('utf-8')
    import re
    regx = r'<input type="hidden" id="lt" name="lt" value="(\S+?)" />';
    pm = re.search(regx,sc)
    csrf = pm.group(1)
    body = {'username':'277432742@qq.com','password':'xwangwang','lt':csrf,'service':'http://www.umeng.com/apps'}
    r,c = h.request(url,'POST',body=urlencode(body))
    print (c.decode("UTF-8"))

def psbcanaly():
    from urllib import urlencode
    headers = {'Cookie': 'BIGipServerwangyin_443_pool=607955136.20480.0000'}
    body = {'_tokenName':'5gx12v',
            '_viewReferer':'creditcard/CreditApplyProQry/CreditApplyProQryOutPre',
            'BankId':'9999',
            'IdType':'01',
            'IdNo':'330725198212285019',
            '_vTokenName':'4rfp',
            'doItButton':'查询'}
    r,c = h.request('https://pbank.psbc.com/pweb/CreditApplyProQry.do','POST',body=urlencode(body))
    print (c.decode('UTF-8'))
    
        
if __name__ == "__main__":
    psbcanaly()
